package cn.com.haopy.yue.ai.db.entity.arisk;


import cn.com.haopy.yue.ai.db.entity.BaseEntity;
import cn.com.haopy.yue.ai.db.mybatis.JsonIntegerArrayTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@TableName(value = "hos_admin", autoResultMap = true)
@ApiModel(value = "后台管理用户")
public class HOSAdmin extends BaseEntity {
    @TableField(value = "username", jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "用户名")
    String username;

    @TableField(value = "name", jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "姓名")
    String name;

    @TableField(value = "password", jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "密码")
    String password;

    @TableField(value = "last_login_ip", jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "上次登录IP地址")
    String lastLoginIp;

    @TableField(value = "last_login_time", jdbcType = JdbcType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "上次登录时间")
    LocalDateTime lastLoginTime;

    @TableField(value = "last_change_password_time", jdbcType = JdbcType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "上次修改密码时间")
    LocalDateTime lastChangePasswordTime;

    @TableField(value = "avatar", jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "头像")
    String avatar;

    @TableField(value = "role_ids", jdbcType = JdbcType.BLOB, typeHandler = JsonIntegerArrayTypeHandler.class)
    @ApiModelProperty(value = "权限列表")
    Integer[] roleIds;

    @TableField(value = "filter_auto_data", jdbcType = JdbcType.BIT)
    @ApiModelProperty(value = "过滤自动数据（问诊、处方）0：否，1是")
    private Boolean filterAutoData;

    @TableField(value = "filter_untrans_data", jdbcType = JdbcType.TINYINT)
    @ApiModelProperty(value = "过滤未上传数据（问诊、处方）0：否，1是")
    private Boolean filterUntransData;
}
